package players;

import model.*;

/**
 * This class is the basis of a Player in a game of Chess. It is extended by {@link players.HumanPlayer} and
 * {@link players.ComputerPlayer}
 * @author Sacha Best
 */
public abstract class Player
{
	/**
	 * These constants represent the colors in a chess game.
	 */
	public static final int WHITE = 19, BLACK = 20;
	/**
	 * The {@link model.ChessBoard} the Player is a member of.
	 */
	protected ChessBoard board;
	/**
	 * The color of the Player.
	 */
	protected final int color;
	/**
	 * Constructs a new Player object with the given board and color
	 * @param board - the {@link model.ChessBoard} the Player is a member of
	 * @param color - the color of the Player
	 */
	public Player(ChessBoard board, int color)
	{
		this.color = color;
		this.board = board;
	}
	/**
	 * @return the color of the player
	 */
	public final int getColor()
	{
		return color;
	}
	/**
	 * This method makes a move by the player with the given {@link model.Location}s from and to.
	 * @param from - the {@link model.Location{ movved from.
	 * @param to - the {@link model.ChessBoard} moved to.
	 * @return the result of {@link model.ChessBoard.completeAction}
	 */
	public String[] makeMove(Location from, Location to)
	{
		return board.completeAction(from, to);
	}
}
